home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d3 / rettig.arc / TRSOURCE.EXE / HEX.C < prev    next >
C/C++ Source or Header  |  1990-10-22  |  566b  |  28 lines

  1. /*********
  2. * HEX.C
  3. *
  4. * by Ralph Davis
  5. * modified by Tom Rettig
  6. *
  7. * Placed in the public domain by Tom Rettig Associates, 10/22/1990.
  8. *
  9. *  Syntax:  HEX( <expN> )
  10. *  Return:  Hexadecimal equivalent of <expN> as <expC>
  11. *********/
  12.  
  13. #include "trlib.h"
  14.  
  15. TRTYPE hex()
  16. {
  17.    static char funcname[] = { "hex" };
  18.  
  19.    if ( PCOUNT==1 && ISNUM(1) )
  20.    {
  21.       long decnum = (long) _parnd(1);
  22.       char *_tr_hexasm();
  23.       _retc( _tr_hexasm(decnum) );  /* _tr_hexasm() does all the work */
  24.    }
  25.    else
  26.       _retc( _tr_errmsgs(funcname,E_SYNTAX) );
  27. }
  28.